package com.example.newsmanager.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.newsmanager.dao.HomeMapper;
import com.example.newsmanager.entity.Home;
import com.example.newsmanager.service.HomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class HomeServiceImpl extends ServiceImpl<HomeMapper, Home> implements HomeService {

    @Autowired
    private HomeMapper homeMapper;
    @Override
    public List<Home> getIndexList(@RequestParam Integer min, @RequestParam Integer max){
        QueryWrapper<Home> queryWrapper = new QueryWrapper<>();
        queryWrapper.between("h_news_id",min,max);
        List<Home> indexList = homeMapper.selectList(queryWrapper);
        return indexList;
    }
}
